#FROM java:8-jre-alpine
FROM java:8u111
MAINTAINER xul@szxxtx.com
VOLUME /tmp
COPY target/xxtx-trade-sim.jar app.jar
#ARG JAR_FILE
#COPY ${JAR_FILE} app.jar

RUN sh -c "touch /app.jar"
ENV JAVA_OPTS="\
-Djava.security.egd=file:/dev/./urandom \
-XX:MetaspaceSize=128M \
-XX:MaxMetaspaceSize=128m \
-Xms5102m -Xmx5102m \
-Xmn1700m \
-Xss256k \
-XX:SurvivorRatio=8 \
-XX:+HeapDumpOnOutOfMemoryError \
-XX:HeapDumpPath=/etc/xxtx-trade-sim.hprof \
-XX:+UseG1GC \
-XX:+PrintGCDetails \
-Xloggc:/etc/trade-gc.log"

ENTRYPOINT java ${JAVA_OPTS} -jar /app.jar